Drop gtk_main and gtk_main_quit
authorMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 03:33:02 +0000 (22:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 04:13:13 +0000 (23:13 -0500)
The alternatives are to use GtkApplication,
or use GMainContext.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkmain.c
gtk/gtkmain.h

index 19632c6b1f5b4c27bf542b0c7a8bd7db573765c9..76b0248402ab92553ac89da50b8130fccd4c0f32 100644 (file)
@@ -4418,8 +4418,6 @@ gtk_get_default_language
 gtk_get_locale_direction
 gtk_init
 gtk_init_check
-gtk_main
-gtk_main_quit
 
 <SUBSECTION>
 gtk_grab_add
index 2869db48466bde11291b03dc9889dd43b26b877f..33fccd8a8072dc8ab49b73de9430fd8bf4f6f102 100644 (file)
 
 static GtkWindowGroup *gtk_main_get_window_group (GtkWidget   *widget);
 
-static guint gtk_main_loop_level = 0;
 static gint pre_initialized = FALSE;
 static gint gtk_initialized = FALSE;
 static GList *current_events = NULL;
 static GThread *initialized_thread = NULL;
 
-static GSList *main_loops = NULL;      /* stack of currently executing main loops */
-
 typedef struct {
   GdkDisplay *display;
   guint flags;
@@ -1011,37 +1008,6 @@ gtk_get_default_language (void)
   return pango_language_get_default ();
 }
 
-/**
- * gtk_main:
- *
- * Runs the main loop until gtk_main_quit() is called.
- *
- * You can nest calls to gtk_main(). In that case gtk_main_quit()
- * will make the innermost invocation of the main loop return.
- */
-void
-gtk_main (void)
-{
-  GMainLoop *loop;
-
-  gtk_main_loop_level++;
-
-  loop = g_main_loop_new (NULL, TRUE);
-  main_loops = g_slist_prepend (main_loops, loop);
-
-  if (g_main_loop_is_running (main_loops->data))
-    g_main_loop_run (loop);
-
-  main_loops = g_slist_remove (main_loops, loop);
-
-  g_main_loop_unref (loop);
-
-  gtk_main_loop_level--;
-
-  if (gtk_main_loop_level == 0)
-    gtk_main_sync ();
-}
-
 typedef struct {
   GMainLoop *store_loop;
   guint n_clipboards;
@@ -1125,20 +1091,6 @@ gtk_main_sync (void)
   _gtk_recent_manager_sync ();
 }
 
-/**
- * gtk_main_quit:
- *
- * Makes the innermost invocation of the main loop return
- * when it regains control.
- */
-void
-gtk_main_quit (void)
-{
-  g_return_if_fail (main_loops != NULL);
-
-  g_main_loop_quit (main_loops->data);
-}
-
 static void
 rewrite_events_translate (GdkSurface *old_surface,
                           GdkSurface *new_surface,
index 9b4016b568a7b54f88fe011855b8dd3aad37281a..dd5e5479535efc4e1639f6854212f43604d4eb1c 100644 (file)
@@ -110,11 +110,6 @@ PangoLanguage *gtk_get_default_language (void);
 GDK_AVAILABLE_IN_ALL
 GtkTextDirection gtk_get_locale_direction (void);
 
-GDK_AVAILABLE_IN_ALL
-void       gtk_main                (void);
-GDK_AVAILABLE_IN_ALL
-void       gtk_main_quit           (void);
-
 GDK_AVAILABLE_IN_ALL
 void       gtk_grab_add            (GtkWidget          *widget);
 GDK_AVAILABLE_IN_ALL